Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up and optimise imports #118

Merged
merged 4 commits into from
Oct 8, 2019
Merged

Tidy up and optimise imports #118

merged 4 commits into from
Oct 8, 2019

Conversation

36degrees
Copy link
Contributor

  • Remove unused font CSS files
  • Remove unused breakpoints
  • Replace printable mixin with govuk-media-query
  • Only include the bits of GOV.UK Frontend we actually need

Reduces the CSS size from 145KB to ~98KB (before gzip)

(I attempted to do the same for the JavaScript, but couldn't get Frontend to play nicely with Sprockets, so that's a job for the future)

Neither of these font files are included anywhere. The font is provided by GOV.UK Frontend.
This selectively imports only the components that we actually need for the tech docs.
@import "govuk/components/input/input";
@import "govuk/components/tag/tag";
@import "govuk/components/skip-link/skip-link";
@import "govuk/components/warning-text/warning-text";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I've done this sort of thing in the past I've left in the full component list as comments for other developers ease of use but probably is an opinionated idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to leave as-is, mainly because I can see a list like that going out of date relatively quickly as we introduce new components etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's a good point 👍

Copy link
Contributor

@NickColley NickColley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🚤

@36degrees 36degrees merged commit 971c403 into master Oct 8, 2019
@36degrees 36degrees deleted the optimise-imports branch October 8, 2019 08:11
36degrees added a commit that referenced this pull request Oct 8, 2019
@36degrees 36degrees added this to the [NEXT] milestone Oct 8, 2019
36degrees added a commit that referenced this pull request Oct 9, 2019
36degrees added a commit that referenced this pull request Oct 9, 2019
Add missing changelog entries from #118 and #119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants